#ifndef HAL_I2C_H
#define HAL_I2C_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_ll_i2c.h"
#include "ll_gpio.h"
#include "ll_exti.h"

#if defined (I2C1) || defined (I2C2) || defined (I2C3)

#if defined(USE_FULL_LL_DRIVER)

#define I2C_MAX 3
#define I2C_TIMEOUT 0xFFFFFFFF

#define I2C1_SCL PB8
#define I2C1_SDA PB9
#define I2C2_SCL PB10
#define I2C2_SDA PB11
#define I2C3_SCL PA8
#define I2C3_SDA PC9

typedef struct
{
    uint16_t scl;
    uint16_t sda;
    I2C_TypeDef *I2Cx;
    LL_I2C_InitTypeDef li2c;
} I2C_Config;

uint8_t LL_I2C_PIN_CONFIG(uint8_t id);
uint32_t LL_GET_I2C_CLK(uint8_t id);

#endif /* USE_FULL_LL_DRIVER */

#endif /* defined (I2C1) || defined (I2C2) || defined (I2C3)*/

#ifdef __cplusplus
}
#endif

#endif /* HAL_I2C_H */